#pragma once

#include <AVUITriggerAction.h>

namespace AVUI {

class Storyboard;

class BeginStoryboard : public TriggerAction
{
public:
    BeginStoryboard() { m_handoffBehavior = HandoffBehavior::SnapshotAndReplace; }

    DECLARE_ELEMENT(BeginStoryboard, TriggerAction);

    DECLARE_DEPENDENCY_PROPERTY_BEGIN(Storyboard);
        DECLARE_ATTRIBUTE_CONTENTPROPERTY();
    DECLARE_DEPENDENCY_PROPERTY_END();
    TRefCountedPtr<Storyboard> get_Storyboard() { return (Storyboard*)(Object*)GetValue(get_StoryboardProperty()); }
    void set_Storyboard(Storyboard* pValue) { SetValue(get_StoryboardProperty(), (Object*)pValue); } 
    
    DECLARE_PROPERTY(HandoffBehavior, HandoffBehavior, false);
    HandoffBehavior::Enum get_HandoffBehavior() { return m_handoffBehavior; }
    void set_HandoffBehavior(HandoffBehavior::Enum value) { m_handoffBehavior = value; }

    virtual void Invoke(FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pTargetStyle, FrameworkTemplate* pTargetTemplate, int layer) AVUI_OVERRIDE;
    virtual void Invoke(FrameworkElement* pElement) AVUI_OVERRIDE;

    void Seal();

private:
    static void StaticConstructor();
    void Begin(DependencyObject* pTarget, int layer);

    HandoffBehavior::Enum m_handoffBehavior;
};


}; // namespace AVUI
